<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>对象的解构赋值</title>
		<script>
			window.onload=function(){
				let { foo, bar } = { foo: 'aaa', bar: 'bbb' };
				console.log('foo='+foo);
				console.log('bar='+bar);
				let { bar1,  foo1} = { foo1: 'aaa', bar1: 'bbb' };
				console.log('foo1='+foo1);
				console.log('bar1='+bar1);
				let {foo2} = {bar: 'baz'};
				console.log('foo2='+foo2);
				let { foo3: baz3 } = { foo3: 'aaa', bar: 'bbb' };
				console.log('baz3='+baz3);
				let obj = { first: 'hello', last: 'world' };
				let { first: f, last: l } = obj;
				console.log('f='+f);
				console.log('l='+l);
				let { foo4: foo4, bar4: bar4 } = { foo4: 'aaa', bar4: 'bbb' };
				console.log('foo4='+foo4);
				console.log('bar4='+bar4);
			}
		</script>
	</head>
	<body>
	</body>
</html>
